package com.blog.filters;

/**
 * 不需要认证
 */
public class URLFilter {
    /**
     * 要放行的路径
     */
    private static final String allUrl = "http://localhost:7777/api/user/login,http://localhost:7777/user/authUser/add";

    /**
     * 校验当前访问路径需要验证权限
     * 不需要验证，false
     * 需要验证，true
     *
     * @param url
     * @return
     */
    public static boolean hasAuthorize(String url) {
        String[] urls = allUrl.split(",");

        for (String uri : urls) {
            if (url.equals(uri)) {
                return false;
            }
        }
        return true;
    }
}
